<?
	require "lib.php";
	
	if(intval($_GET["id"]) && stripslashes($_GET["bid"])) {
		$board_info = boardInfo($_GET["bid"]);		
		$article = getArticle($_GET["bid"], intval($_GET["id"]));
		if($article["memberid"] == $_SESSION["loginIdx"] || $_SESSION["loginAdmin"] == "True" || $board_info["writeadmin"] == "0") {
			if(deleteArticle($_GET["bid"], intval($_GET["id"])))
				alertAndMove("글 삭제 성공!", "list.php?bid=".$_GET["bid"]);
			else { alertAndBack("글 삭제 실패"); exit; }
		}
		else { alertAndBack("잘못된 접근입니다!"); exit; }
	}
	else { alertAndBack("잘못된 접근입니다!"); exit; }
?>